package org.rency.ues.request;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.rency.ues.common.enums.EncryptType;

public class UesRequest {
	
	/**
	 * 密钥
	 */
	private String ticket;
	/**
	 * 明文
	 */
	private String plainData;
	/**
	 * 加密方式
	 */
	private EncryptType encryptType = EncryptType.RSA;
	/**
	 * 有效时间(单位:秒,0:默认30天)
	 */
	private long expireTime = 0;
	/**
	 * 证书序列号
	 */
	private String serialNo;
	
	public UesRequest(){}
	
	/**
	 * 加密
	 * @param ticket
	 * @param plainData
	 * @param encryptType
	 * @param expireTime
	 * @param serialNo
	 */
	public UesRequest(String ticket,String plainData,EncryptType encryptType,long expireTime,String serialNo){
		this.ticket = ticket;
		this.plainData = plainData;
		this.encryptType = encryptType;
		this.expireTime = expireTime;
		this.serialNo = serialNo;
	}

	/**
	 * 解密
	 * @param ticket
	 * @param encryptType
	 * @param serialNo
	 */
	public UesRequest(String ticket,EncryptType encryptType,String serialNo){
		this.ticket = ticket;
		this.encryptType = encryptType;
		this.serialNo = serialNo;
	}
	
	public String getTicket() {
		return ticket;
	}

	public void setTicket(String ticket) {
		this.ticket = ticket;
	}

	public String getPlainData() {
		return plainData;
	}

	public void setPlainData(String plainData) {
		this.plainData = plainData;
	}

	public EncryptType getEncryptType() {
		return encryptType;
	}

	public void setEncryptType(EncryptType encryptType) {
		this.encryptType = encryptType;
	}

	public long getExpireTime() {
		return expireTime;
	}

	public void setExpireTime(long expireTime) {
		this.expireTime = expireTime;
	}

	public String getSerialNo() {
		return serialNo;
	}

	public void setSerialNo(String serialNo) {
		this.serialNo = serialNo;
	}

	@Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
    }
	
}